public class DyadicArray {
    public static void main(String[] args) {
        //定义二维数组earnCount，存储每个季度的营业额
        int[][] earnCount = {
                {22, 55, 44},
                {77, 33, 88},
                {25, 45, 65},
                {11, 66, 99}
        };

        //定义变量yearEarn，存储每年的营业额
        int yearEarn = 0;
        //遍历二维数组earnCount
        for (int i = 0; i < 4; i++) {
            //定义变量mouthEarn，存储每个季度的营业额
            int mouthEarn = 0;
            //遍历二维数组earnCount的每一行
            for (int j = 0; j < 3; j++) {
                //获取二维数组earnCount的每个元素
                int temp = earnCount[i][j];
                //累加每个季度的营业额
                mouthEarn += temp;
                //输出二维数组earnCount的每个元素
                System.out.print(earnCount[i][j] + " ");
            }
            //换行
            System.out.println();
            //输出每个季度的营业额
            System.out.println("第" + (i + 1) + "个" + "季度的营业额为：" + mouthEarn);
            //累加每年的营业额
            yearEarn += mouthEarn;


        }

        //换行
        System.out.println();
        //输出每年的营业额
        System.out.println("总营业额为：" + yearEarn);
    }

}
